home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / graphics / sprite10.arj / VGA18.DOC < prev    next >
Text File  |  1994-02-09  |  6KB  |  167 lines

  1. ┌───────────────────┐
  2. │ THE VGA18 LIBRARY │
  3. └───────────────────┘
  4.  
  5.  This  library  is a basis library of sprites functions for the
  6. VGA 18 mode, with  640  x  480 resolution.
  7.  It hold 256 color (displayed as 16 color), F16, EAS sprite.
  8.   All  other  sprite  formats  are  included  in the registered
  9. library that holds functions for bitmap 16 colors compressed or
  10. no.
  11.   You  also  get the ASM source of this VGA 18 library with the
  12. registered version.
  13.   Way  in  which  a sprite is displayed depends both the chosen
  14. function  and  the  VGA  writing  mode defined by the WRITEMODE
  15. function.  This  function sets the COPY, AND, OR or XOR logical
  16. modes  for  all  further  displays. Functions of sprite handles
  17. three  drawing  modes: COPY, OVER background, UNDER background.
  18. Sprites modes and VGA modes can be combined.
  19.  In COPY mode, the background of the image of the sprite is put
  20. on  the  screen, in OVER mode, only the no black pixels are put
  21. on the screen, in UNDER mode, the no black pixels of the sprite
  22. replace the previous black pixels on the screen.
  23.  
  24.  
  25. VGA 18 library variables:
  26.  
  27. BORDER OF THE GRAPHICAL WINDOW
  28. int  XL18;      Left border in pixels.
  29. int  YT18;      Top.
  30. int  XR18;      Right border in pixels.
  31. int  YB18;      Bottom.
  32. char XBL;       Left border in bytes.
  33. char XBR;       Right in bytes.
  34.  
  35. extern char COLOR16;    Current color.
  36.  
  37. char PENCOL18;        Text color.
  38. char PALETTE;         Current palette number.
  39.  
  40. char    count;       Internal variable.
  41. FILE    *SF          Internal variable.
  42.  
  43.  
  44. VGA 18 library functions.
  45.  
  46. All  sprite functions but MSPRITE display sprite from bottom to
  47. top of the screen.
  48.  
  49. For functions having pixel coordinate,
  50.        x = 0..639,
  51.        y = 0..479.
  52. For functions with no boundary,
  53.        x = 0..79.
  54.        y = 0..479.
  55.   The  address  is either the absolute address in memory of the
  56. sprite or value the GETSPspriteadr function of MCGALIB returns.
  57.  
  58.  
  59. void setscreen2(int mode);
  60.   Set the screen resolution:
  61.   18 = VGA high resolution.
  62.    3 = Text mode.
  63.  
  64. int VRTload(int x,int y,char *adr,char *name);
  65.   Load  and  display  a VRT screen. adr must point out a memory
  66. buffer size of which being that of the file.
  67.  
  68. void writemode(int code);
  69.   Set  the  VGA  write  mode. Codes for the 'code' variable are
  70. those of the VGA card, and no the same some languages use.
  71.     0 = COPY.
  72.     8 = AND.
  73.    16 = OR.
  74.    24 = XOR.
  75.  
  76.  
  77. void window18(int left,int top,int right,int bottom);
  78.   Set the window borders.
  79.  
  80. void cls18(int color);
  81.   Clear the screen inside the windows, with the color (0..15).
  82.  
  83. char *getspadr18(int ns);
  84.    Get address of sprite number ns.
  85.  
  86. void setpalvga(int col,int register);
  87.    Set value "register" to the color.
  88.    Value 0..63, color 0..15.
  89.  
  90. void setallvga(unsigned char *paladdress);
  91.     Set the 16 colors palette, with values the 'paladdress' va-
  92. riable
  93. points  out.  The  field holds 17 numbers, the first is unused,
  94. the  followings  are values of the 16 colors. This don's change
  95. RGB registers, one can use MCGALIB functions for that.
  96.  
  97. void putsxy(int x, int y,char *string);
  98.   Put the string at x,y. With color PENCOL18.
  99.   x = 1..80
  100.   y = 1..30
  101.  
  102. int getfast(int xl,int yt,int xr,int yb,char *BUFFER);
  103.  Get a block of screen to BUFFER which must be previously
  104. allocate. Use fastsprite to put it on the screen.
  105.  
  106. void fastsprite(int x,int y,char *spriteadr);
  107.  Display a F16 sprite with no boundary, in COPY mode, and logi-
  108. cal mode according to the WRITEMODE setting.
  109.  
  110. void fastspritec(int x,int y,char *spriteadr);
  111.  The same function with window limits.
  112.  
  113. void nbfastsprite(int x,int y,char *spriteadr,int code);
  114.   Display  a  F16 sprite with pixel coordinate, in OVER drawing
  115. mode,  with  logical mode according to 'code'. Reset setting of
  116. the WRITEMODE function.
  117.  
  118. void easprite(int x,int y,char *spriteadr);
  119.  Display an EAS sprite, no boundary, with OVER drawing mode.
  120.  
  121. void fasteasprite(int x,int y,char *spriteadr);
  122.  As the previous one, with COPY drawing mode.
  123.  
  124.  
  125. void sp256(int x,int y,char *spriteadr);
  126.   Display  a  256 colors sprite, with pixel coordinate, with 16
  127. colors and OVER drawing mode.
  128.  
  129. void sp256(int x,int y,char *spriteadr);
  130.   The same function with window limits.
  131.  
  132. void csp256(int x,int y,char *spriteadr);
  133.   As the previous one, with COPY drawing mode.
  134. void icon18(int x,int y,char *spriteadr);
  135.   Display an icon created with the i, j or k commands of MegaS-
  136. prites (with pixel coordinate).
  137.  
  138. void csp256(int x,int y,char *spriteadr);
  139.   The same function with window limits.
  140.  
  141. void icon18(int x,int y,char *spriteadr);
  142.   Display a 16 color icon. Color 9 is the background color.
  143.  
  144.  
  145. VGA18.OBJ
  146.  
  147.  The  assembly 80286, VGA18.OBJ module can be linked to a pro-
  148. gram  of  any language, according to the instructions manual of
  149. the language gives.
  150.   Using  the C language, one may include the VGA18.h header. in
  151. the C source of the program.
  152.  Option are:
  153. - Model large.
  154. - Case-sensitive.
  155.  
  156.  
  157. SPRTEST.C
  158. This example program show how to use some sprite functions pro-
  159. vided in the VGA18 library, with an automaton.
  160. The  method  I use here is the simplest: I put a sprite in COPY
  161. mode  that  erases himself the previous image. The black border
  162. of the sprite allows a shift of the image.
  163. Another simple method is to use the XOR mode with a reduced set
  164. of color inside the animation field. The best of all is the co-
  165. lor  plane technique. More on all that with examples in the re-
  166. gistered version...
  167.